#! /usr/bin/php
<?php
/**
 * Copyright (c) 2006-2008, Julien PORTALIER
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright    Copyright (c) 2006-2008, Julien PORTALIER
 * @link         http://featherphp.googlecode.com/
 * @license      http://www.opensource.org/licenses/mit-license.php The MIT License
 */

# basics
define('DS',       DIRECTORY_SEPARATOR);
define('FEATHER',  dirname(__FILE__).DS.'feather2'.DS);
require FEATHER.'basics.php';

if (env('argc') < 2)
	die("Error: nothing to do.\n");

# paths
define('APP',      env('PWD').DS);
define('ROOT',     dirname(APP).DS);
define('SCRIPTS',  APP.'scripts'.DS);
define('WWW_ROOT', APP.'webroot'.DS);

define('PROTOCOL', 'http://');

# config
require APP.'config'.DS.'core.php';

# libs
require FEATHER.'libs'.DS.'base.php';
require FEATHER.'libs'.DS.'dispatcher.php';

Dispatcher::script($_SERVER['argv'][1], isset($_SERVER['argv'][2]) ? $_SERVER['argv'][2] : 'main');
?>